package com.trippin.server;

public class TrippinDateTime {
	private int year;
	private int month;
	private int day;
	private int hour;
	private int minutes;
	private int GMT; 
	
	public TrippinDateTime(int year, int month, int day, int hour, int minutes, int GMT) {
		this.year = year;
		this.month = month;
		this.day = day;
		this.hour = hour;
		this.minutes = minutes;
		this.GMT = GMT;
		
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public int getMonth() {
		return month;
	}

	public void setMonth(int month) {
		this.month = month;
	}

	public int getDay() {
		return day;
	}

	public void setDay(int day) {
		this.day = day;
	}

	public int getHour() {
		return hour;
	}

	public void setHour(int hour) {
		this.hour = hour;
	}

	public int getMinutes() {
		return minutes;
	}

	public void setMinutes(int minutes) {
		this.minutes = minutes;
	}

	public int getGMT() {
		return GMT;
	}

	public void setGMT(int gMT) {
		GMT = gMT;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof TrippinDateTime))
			return false;
		if(this == obj)
			return true;
		
		TrippinDateTime tdt = (TrippinDateTime)obj;
		if(this.year != tdt.getYear())
			return false;
		else if(this.month != tdt.getMonth())
			return false;
		else if(this.day != tdt.getDay())
			return false;
		else if(this.hour != tdt.getHour())
			return false;
		else if(this.minutes != tdt.getMinutes())
			return false;
		else if(this.getGMT() != tdt.getGMT())
			return false;
		else
			return true;
		
	}
	public String toString() {
		return String.format("%02d/%02d/%4d %02d:%02d %+03d", 
				getDay(), getMonth(), getYear(), getHour(), getMinutes(), getGMT());		
	}
	
}
